package uintTest;

import edu.pku.group6.webservices.*;

public class UnitTestPublishEnterpriseNews {
	public static void Publish(){
		
		System.out.println("Enterprise Publish News Test");
		
		EnterpriseService es = new EnterpriseService();
		System.out.println("Input Enterprise ID = 2");
		int uid = es.GetUserID(2);
		System.out.println("Get Enterprise User ID = " + uid);
		EHonestService ehs = new EHonestService();
		int level = ehs.getLevel(uid);
		System.out.println("Check User Honest Level = " + level);
		NewsService ns = new NewsService();
		
		if(level<3){
			System.out.println("No Publish Authority");
			return;
		}
		else if (level==3){
			
			System.out.println("Publish Authority : " + false);
			ns.AddNews("title", "content", uid,false);
		}
		else{
			
			System.out.println("Publish Authority : " + true);
			ns.AddNews("title", "content", uid,true);
		}
			
		
	}
	
}
